3.1.71 \(\int \frac {(2-x-2 x^2+x^3) (d+e x+f x^2+g x^3+h x^4)}{4-5 x^2+x^4} \, dx\) [71]

Optimal. Leaf size=68 \[ (e-2 f+4 g-8 h) x+\frac {1}{2} (f-2 g+4 h) x^2+\frac {1}{3} (g-2 h) x^3+\frac {h x^4}{4}+(d-2 e+4 f-8 g+16 h) \log (2+x) \]

[Out]

(e-2*f+4*g-8*h)*x+1/2*(f-2*g+4*h)*x^2+1/3*(g-2*h)*x^3+1/4*h*x^4+(d-2*e+4*f-8*g+16*h)*ln(2+x)

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 68, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 46, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.043, Rules used = {1600, 1864} \begin {gather*} \log (x+2) (d-2 e+4 f-8 g+16 h)+x (e-2 f+4 g-8 h)+\frac {1}{2} x^2 (f-2 g+4 h)+\frac {1}{3} x^3 (g-2 h)+\frac {h x^4}{4} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((2 - x - 2*x^2 + x^3)*(d + e*x + f*x^2 + g*x^3 + h*x^4))/(4 - 5*x^2 + x^4),x]

[Out]

(e - 2*f + 4*g - 8*h)*x + ((f - 2*g + 4*h)*x^2)/2 + ((g - 2*h)*x^3)/3 + (h*x^4)/4 + (d - 2*e + 4*f - 8*g + 16*
h)*Log[2 + x]

Rule 1600

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rule 1864

Int[(Pq_)*((a_) + (b_.)*(x_)^(n_.))^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x^n)^p, x], x] /; FreeQ[
{a, b, n}, x] && PolyQ[Pq, x] && (IGtQ[p, 0] || EqQ[n, 1])

Rubi steps

\begin {align*} \int \frac {\left (2-x-2 x^2+x^3\right ) \left (d+e x+f x^2+g x^3+h x^4\right )}{4-5 x^2+x^4} \, dx &=\int \frac {d+e x+f x^2+g x^3+h x^4}{2+x} \, dx\\ &=\int \left (e \left (1-\frac {2 (f-2 g+4 h)}{e}\right )+(f-2 g+4 h) x+(g-2 h) x^2+h x^3+\frac {d-2 e+4 f-8 g+16 h}{2+x}\right ) \, dx\\ &=(e-2 f+4 g-8 h) x+\frac {1}{2} (f-2 g+4 h) x^2+\frac {1}{3} (g-2 h) x^3+\frac {h x^4}{4}+(d-2 e+4 f-8 g+16 h) \log (2+x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 68, normalized size = 1.00 \begin {gather*} (e-2 f+4 g-8 h) x+\frac {1}{2} (f-2 g+4 h) x^2+\frac {1}{3} (g-2 h) x^3+\frac {h x^4}{4}+(d-2 e+4 f-8 g+16 h) \log (2+x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((2 - x - 2*x^2 + x^3)*(d + e*x + f*x^2 + g*x^3 + h*x^4))/(4 - 5*x^2 + x^4),x]

[Out]

(e - 2*f + 4*g - 8*h)*x + ((f - 2*g + 4*h)*x^2)/2 + ((g - 2*h)*x^3)/3 + (h*x^4)/4 + (d - 2*e + 4*f - 8*g + 16*
h)*Log[2 + x]

________________________________________________________________________________________

Maple [A]
time = 0.03, size = 72, normalized size = 1.06

method result size
norman \(\left (\frac {g}{3}-\frac {2 h}{3}\right ) x^{3}+\left (\frac {f}{2}-g +2 h \right ) x^{2}+\left (e -2 f +4 g -8 h \right ) x +\frac {h \,x^{4}}{4}+\left (d -2 e +4 f -8 g +16 h \right ) \ln \left (x +2\right )\) \(65\)
default \(\frac {h \,x^{4}}{4}+\frac {g \,x^{3}}{3}-\frac {2 h \,x^{3}}{3}+\frac {f \,x^{2}}{2}-g \,x^{2}+2 h \,x^{2}+e x -2 f x +4 g x -8 h x +\left (d -2 e +4 f -8 g +16 h \right ) \ln \left (x +2\right )\) \(72\)
risch \(\frac {h \,x^{4}}{4}+\frac {g \,x^{3}}{3}-\frac {2 h \,x^{3}}{3}+\frac {f \,x^{2}}{2}-g \,x^{2}+2 h \,x^{2}+e x -2 f x +4 g x -8 h x +\ln \left (x +2\right ) d -2 \ln \left (x +2\right ) e +4 \ln \left (x +2\right ) f -8 \ln \left (x +2\right ) g +16 \ln \left (x +2\right ) h\) \(87\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^3-2*x^2-x+2)*(h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x,method=_RETURNVERBOSE)

[Out]

1/4*h*x^4+1/3*g*x^3-2/3*h*x^3+1/2*f*x^2-g*x^2+2*h*x^2+e*x-2*f*x+4*g*x-8*h*x+(d-2*e+4*f-8*g+16*h)*ln(x+2)

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 67, normalized size = 0.99 \begin {gather*} \frac {1}{4} \, h x^{4} + \frac {1}{3} \, {\left (g - 2 \, h\right )} x^{3} + \frac {1}{2} \, {\left (f - 2 \, g + 4 \, h\right )} x^{2} - {\left (2 \, f - 4 \, g + 8 \, h - e\right )} x + {\left (d + 4 \, f - 8 \, g + 16 \, h - 2 \, e\right )} \log \left (x + 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^3-2*x^2-x+2)*(h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="maxima")

[Out]

1/4*h*x^4 + 1/3*(g - 2*h)*x^3 + 1/2*(f - 2*g + 4*h)*x^2 - (2*f - 4*g + 8*h - e)*x + (d + 4*f - 8*g + 16*h - 2*
e)*log(x + 2)

________________________________________________________________________________________

Fricas [A]
time = 0.40, size = 62, normalized size = 0.91 \begin {gather*} \frac {1}{4} \, h x^{4} + \frac {1}{3} \, {\left (g - 2 \, h\right )} x^{3} + \frac {1}{2} \, {\left (f - 2 \, g + 4 \, h\right )} x^{2} + {\left (e - 2 \, f + 4 \, g - 8 \, h\right )} x + {\left (d - 2 \, e + 4 \, f - 8 \, g + 16 \, h\right )} \log \left (x + 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^3-2*x^2-x+2)*(h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="fricas")

[Out]

1/4*h*x^4 + 1/3*(g - 2*h)*x^3 + 1/2*(f - 2*g + 4*h)*x^2 + (e - 2*f + 4*g - 8*h)*x + (d - 2*e + 4*f - 8*g + 16*
h)*log(x + 2)

________________________________________________________________________________________

Sympy [A]
time = 0.09, size = 63, normalized size = 0.93 \begin {gather*} \frac {h x^{4}}{4} + x^{3} \left (\frac {g}{3} - \frac {2 h}{3}\right ) + x^{2} \left (\frac {f}{2} - g + 2 h\right ) + x \left (e - 2 f + 4 g - 8 h\right ) + \left (d - 2 e + 4 f - 8 g + 16 h\right ) \log {\left (x + 2 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**3-2*x**2-x+2)*(h*x**4+g*x**3+f*x**2+e*x+d)/(x**4-5*x**2+4),x)

[Out]

h*x**4/4 + x**3*(g/3 - 2*h/3) + x**2*(f/2 - g + 2*h) + x*(e - 2*f + 4*g - 8*h) + (d - 2*e + 4*f - 8*g + 16*h)*
log(x + 2)

________________________________________________________________________________________

Giac [A]
time = 3.45, size = 74, normalized size = 1.09 \begin {gather*} \frac {1}{4} \, h x^{4} + \frac {1}{3} \, g x^{3} - \frac {2}{3} \, h x^{3} + \frac {1}{2} \, f x^{2} - g x^{2} + 2 \, h x^{2} - 2 \, f x + 4 \, g x - 8 \, h x + x e + {\left (d + 4 \, f - 8 \, g + 16 \, h - 2 \, e\right )} \log \left ({\left | x + 2 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^3-2*x^2-x+2)*(h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="giac")

[Out]

1/4*h*x^4 + 1/3*g*x^3 - 2/3*h*x^3 + 1/2*f*x^2 - g*x^2 + 2*h*x^2 - 2*f*x + 4*g*x - 8*h*x + x*e + (d + 4*f - 8*g
 + 16*h - 2*e)*log(abs(x + 2))

________________________________________________________________________________________

Mupad [B]
time = 0.03, size = 64, normalized size = 0.94 \begin {gather*} x^3\,\left (\frac {g}{3}-\frac {2\,h}{3}\right )+\ln \left (x+2\right )\,\left (d-2\,e+4\,f-8\,g+16\,h\right )+\frac {h\,x^4}{4}+x^2\,\left (\frac {f}{2}-g+2\,h\right )+x\,\left (e-2\,f+4\,g-8\,h\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-((x + 2*x^2 - x^3 - 2)*(d + e*x + f*x^2 + g*x^3 + h*x^4))/(x^4 - 5*x^2 + 4),x)

[Out]

x^3*(g/3 - (2*h)/3) + log(x + 2)*(d - 2*e + 4*f - 8*g + 16*h) + (h*x^4)/4 + x^2*(f/2 - g + 2*h) + x*(e - 2*f +
 4*g - 8*h)

________________________________________________________________________________________